package com.usian.user.controller.v1;

import com.usian.apis.user.ApUserControllerApi;
import com.usian.apis.user.ApUserLoginControllerApi;
import com.usian.model.user.pojos.ApUser;
import com.usian.user.service.impl.ApUserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zlm
 * @version 1.0
 * @date 2022/9/24 10:36
 */
@RestController
@RequestMapping("/api/v1/user")
public class ApUserController implements ApUserControllerApi {
    @Autowired
    private ApUserServiceImpl apUserService;

    @GetMapping("/{id}")
    @Override
    public ApUser findUserById(@PathVariable Integer id) {
        if (id == null){
            System.out.println("用户id不存在");
            return new ApUser();
        }
        return apUserService.getById(id);
    }
}
